package com.fang.transfer.file.client.listener;

import com.fang.transfer.file.client.AppContext;
import com.fang.transfer.file.client.thread.FileCheckThread;
import com.fang.transfer.file.common.RequestListener;
import com.fang.transfer.file.common.code.ServiceSendCode;
import com.fang.transfer.file.common.model.TransferFileRequest;

/**
 * 文件完整检查
 */
public class FileCheckListener extends RequestListener<TransferFileRequest> {

    @Override
    public void handle(TransferFileRequest param) throws Exception {
        TransferFileRequest request = AppContext.transferFileRequestMap.get(param.getId());
        AppContext.poolExecutor.execute(new FileCheckThread(request));
    }

    @Override
    public String getCode() {
        return ServiceSendCode.FILE_CHECK;
    }
}
